﻿using ChartDirector;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace QuMianChaZhi
{
    class MyWinChartViewer: WinChartViewer
    {
        protected override void OnPaint(PaintEventArgs e)
        {

            var path = new System.Drawing.Drawing2D.GraphicsPath();
            path.AddEllipse(20, 20, 460, 460);



            Region region = new Region(path);

            // Draw the outline of the region.
            Pen pen = Pens.Black;
            e.Graphics.DrawPath(pen, path);

            // Set the clipping region of the Graphics object.
            e.Graphics.SetClip(region, CombineMode.Replace);



            base.OnPaint(e);


            Rectangle rc = new Rectangle(0, 0, 500, 500);
            e.Graphics.SetClip(rc, CombineMode.Replace);

            


            Brush brsh = new SolidBrush(Color.Red);

            Pen p = new Pen(brsh,20);
            Rectangle rcLine = new Rectangle(10, 10, 480, 480);
            e.Graphics.DrawEllipse(p, rcLine);


            Brush brushWhite = new SolidBrush(Color.White);

            Rectangle rcNotch = new Rectangle(245, 490, 20, 20);

            e.Graphics.FillEllipse(brushWhite, rcNotch);
            ////g.FillEllipse(brsh, rx - 4, ry - 4, 8, 8);

            //e.Graphics.FillEllipse(brsh, 50,50, 20, 20);
        }
    }
}
